#ifndef QMENUBUTTON_H
#define QMENUBUTTON_H
#include <QPushButton>
#include <QLabel>
#include <QVBoxLayout>
#include <QMouseEvent>
#include <QPainter>

class QMenuButton : public QPushButton
{
public:
    QMenuButton(QWidget * parent = nullptr);

    void setNormalImg(QString s);
    void sethoverImg(QString s);
    void setPressImg(QString s);
    void setButtonTxt(QString s);

    void enterEvent(QEvent *);
    void leaveEvent(QEvent *);
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);

    bool needSelect = false;

private:
   enum ButtonStatus{NORMAL, HOVER, PRESS};
   ButtonStatus status;
   QString icon_path;
   bool mouse_press;
   QString normalImg;
   QString hoverImg;
   QString pressImg;
   QLabel *buttonTxt;
   QLabel *buttonImage;
};

#endif // QMENUBUTTON_H
